home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 63 / 063.d81 / jeff's top ten (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  6KB  |  182 lines

  1. 100 goto120
  2. 110 return
  3. 120 clr:dimtt$(120),h$(12),c(7),mu$(12),no(12)
  4. 130 sp$="                                       ":x$=chr$(13):poke646,rnd(-ti)
  5. 140 h$(12)="     [218][218][218][218]  option menu  [218][218][218][218]"
  6. 150 poke53281,0:poke53280,0:printchr$(142)"[147]";:goto290
  7. 160 print"";
  8. 170 print"  [151][169][153][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  9. 180 print" [151][169] [153][221]                                  [221]"
  10. 190 print" [151]  [153][171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]"
  11. 200 fori=1to12:print" [151]  [153][221][152]                                  [153][221]":next
  12. 210 print" [151]  [153][173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  13. 220 print" [151] N                                   [146][169]"
  14. 230 print" N                                   [146][169]"
  15. 240 print" [154][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185]"
  16. 250 fori=1to4:print" [159]                                      ":next
  17. 260 print" [184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184]"
  18. 270 print"";:return
  19. 280 rem setup
  20. 290 gosub160:rem menu
  21. 300 fori=1to7:readc(i):next:fori=1to12:readmu$(i):next
  22. 310 ms$="please wait 7 seconds...":gosub550
  23. 320 open2,8,2,"lists":get#2,a$,a$:fori=1to110:input#2,tt$(i):next:close2
  24. 330 gosub1450
  25. 340 lt=0:poke214,24
  26. 341 poke211,0:sys58732:print"[146]                                      [145]"
  27. 342 ms$="please select top-ten topic":gosub550:t(0)=0:t(1)=0:s(0)=0:s(1)=0:it=1
  28. 350 gosub1360:lt=0:no$="111100000000":fori=1to10:h$(i)=tt$(i):next
  29. 360 gosub570:ifit=12thengosub780:goto350
  30. 370 rem game
  31. 380 ms$="randomizing the list...":gosub550:gosub700:no$="000000000000":poke211,0
  32. 381 poke214,24:sys58732:print"[146][159]                                      [145]"
  33. 382 printspc(20-len(tt$(lt))/2)tt$(lt)"[145]"
  34. 390 ms$=pl$(pl)+"pick item to move...":gosub550:gosub570
  35. 400 ifit=12thengosub780:goto460
  36. 410 iftt$(lt*10+it)=h$(it)thent(pl)=t(pl)+1:goto460
  37. 420 ms$=pl$(pl)+"place your pick...":gosub550:gosub1210
  38. 430 t(pl)=t(pl)+1
  39. 440 iftt$(lt*10+it)=h$(it)thens(pl)=s(pl)+1:fori=1to3:gosub1780:next:goto480
  40. 450 iftt$(lt*10+it)<>h$(it)thengosub1730
  41. 460 gosub1730:ifnpthenlp=notlp:pl=abs(lp)
  42. 470 ifmt=4thenmt=1:goto340
  43. 480 gosub1360:goto390
  44. 490 stop
  45. 500 data 15,12,11,12,15,1,15
  46. 510 datathis list is in order!,see which items are out-of-place
  47. 520 datawimp out and see solution,try a different subject,exit to loadstar
  48. 530 data,,,,,,"     [218][218][218][218] return to list [218][218][218][218]"
  49. 540 rem print message at top of menu
  50. 550 print"[155]"left$(sp$,34)""spc(21-len(ms$)/2)ms$:return
  51. 560 rem generic menu
  52. 570 ifit=0thenit=1
  53. 580 print"";:fori=1to12
  54. 590 print"[152] "h$(i)left$(sp$,33-len(h$(i))):next:print
  55. 600 geta$:gosub660:ifa$<>"[145]"anda$<>""anda$<>x$then600
  56. 610 ifa$=""thenc=2.5:gosub670:it=it+1:ifit>12thenit=1
  57. 620 ifa$="[145]"thenc=2.5:gosub670:it=it-1:ifit<1thenit=12
  58. 630 c=5.5:gosub670:ifh$(it)=""then610
  59. 640 ifa$=x$thenreturn
  60. 650 goto600
  61. 660 c=c+.5:ifc>7thenc=1
  62. 670 poke646,c(c):poke214,2+it:poke211,4:sys58732
  63. 680 print" "h$(it)left$(sp$,33-len(h$(it))):return
  64. 690 rem randomize list
  65. 700 lt=it:fori=1to10:h$(i)=tt$(it*10+i):next
  66. 710 fori=1to10
  67. 720 p=int(rnd(0)*10)+1
  68. 730 ifh$(p)=""thenp=p-1:goto730
  69. 740 ifh$(i)=""thennext:goto770
  70. 750 a$=h$(i):h$(i)=h$(p):h$(p)=a$
  71. 760 next
  72. 770 ms$=" ":gosub550:return
  73. 780 gosub1540:ms$="option[160]menu":gosub550:mt=1:print"";:fori=1to12
  74. 790 print"[152] "mu$(i)left$(sp$,33-len(mu$(i))):next:print
  75. 800 ifno(1)thenpoke631,asc(""):poke198,1
  76. 810 geta$:gosub880:ifa$<>"[145]"anda$<>""anda$<>x$then810
  77. 820 ifa$=""thenc=2.5:gosub890:mt=mt+1:ifmt>12thenmt=1
  78. 830 ifa$="[145]"thenc=2.5:gosub890:mt=mt-1:ifmt<1thenmt=12
  79. 840 c=5.5:gosub890:ifmu$(mt)=""orno(mt)thenpoke198,0:goto820
  80. 850 ifa$=x$thenifmt=12ormt=4thenreturn
  81. 860 ifa$=x$thengosub910:ms$="":gosub550:goto780
  82. 870 goto810
  83. 880 c=c+.5:ifc>7thenc=1
  84. 890 poke646,c(c):poke214,2+mt:poke211,4:sys58732
  85. 900 print" "mu$(mt)left$(sp$,33-len(mu$(mt))):return
  86. 910 onmtgosub940,1050,1110,1170,1660,110,110,110,110,110,110,1180
  87. 920 return
  88. 930 rem check list integrity/winner
  89. 940 poke198,0:fl=0:fori=1to10:iftt$(lt*10+i)<>h$(i)thenfl=1
  90. 950 next:ifflthenms$="oh no it's not! press a key.":gosub550:gosub1730
  91. 960 ifflthens(pl)=s(pl)-10:ifs(pl)<0thens(pl)=0
  92. 970 ifflththengosub1360:wait198,1:return
  93. 980 ms$="you're right! you did it!":gosub550:s(pl)=s(pl)+10:t(pl)=t(pl)+10
  94. 990 no$="111001111111":gosub1540:gosub1360:gosub1830:ifnpthengosub1010
  95. 1000 return
  96. 1010 wi=0:ifs(1)>s(0)thenwi=1
  97. 1020 ms$=pl$(wi)+"wins!  press a key...":gosub550:poke198,0:wait198,1
  98. 1030 no$="111001111111":gosub1360:return
  99. 1040 rem see which items are misplaced
  100. 1050 print"";:fori=1to10:poke646,12
  101. 1060 iftt$(lt*10+i)<>h$(i)thenpoke646,11
  102. 1070 print" "h$(i)left$(sp$,33-len(h$(i))):next:gosub1730
  103. 1080 ms$="shaded items are misplaced":gosub550
  104. 1090 t(pl)=t(pl)+1:gosub1360:poke198,0:wait198,1:return
  105. 1100 rem wimp out
  106. 1110 ms$="you sure? you'll lose all points":gosub550:poke198,0:wait198,1
  107. 1120 geta$:ifa$<>"y"thenreturn
  108. 1130 print"";:fori=1to10:gosub1730
  109. 1140 print"[152] "tt$(lt*10+i)left$(sp$,33-len(tt$(lt*10+i))):next
  110. 1150 ms$="press a key...":gosub550:poke198,0
  111. 1160 s(pl)=0:t(pl)=t(pl)+1:gosub1360:wait198,1:geta$:return
  112. 1170 return
  113. 1180 return
  114. 1190 stop
  115. 1200 rem place item
  116. 1210 p$=h$(it):fl=0:fori=10to1step-1:ifh$(i)=""thenfl=i
  117. 1220 next:iffl=0thenfl=10
  118. 1230 iffl<>10andfl<>0thenfl=fl-1
  119. 1240 geta$:gosub660:ifa$<>"[145]"anda$<>""anda$<>x$then1240
  120. 1250 ifa$=""thenifit<flthenc=2.5:gosub1300:gosub670:it=it+1:ifit>flthenit=1
  121. 1260 ifa$="[145]"thenifit>1thenc=2.5:gosub1300:gosub670:it=it-1:ifit<1thenit=fl
  122. 1270 ifh$(it)=""then1250
  123. 1280 ifa$=x$thenreturn
  124. 1290 goto1240
  125. 1300 ifit=12thenreturn
  126. 1310 p1$=h$(it+1):p2$=h$(it-1)
  127. 1320 ifa$="[145]"thenh$(it)=p2$:h$(it-1)=p$
  128. 1330 ifa$=""thenh$(it)=p1$:h$(it+1)=p$
  129. 1340 return
  130. 1350 rem take care of player info
  131. 1360 poke214,20:poke211,sp:sys58732:poke646,3
  132. 1370 print"score:    [157][157][157][157]"s(0);:ifnpthenprinttab(19)"score:";
  133. 1380 ifnpthenpoke214,20:poke211,28:sys58732:print"    [157][157][157][157]"s(1)
  134. 1390 poke214,21:poke211,sp:sys58732
  135. 1400 print"accuracy:    [157][157][157][157]";:ift(0)thenprintint(s(0)/(t(0)/100)+.5)"[157]%   ";
  136. 1401 ifnpthenprinttab(19)"accuracy:    "
  137. 1410 ifnpthenpoke214,21:poke211,28:sys58732
  138. 1420 ifnpthenift(1)thenprint"    [157][157][157][157]"int(s(1)/(t(1)/100)+.5)"[157]%   "
  139. 1430 return
  140. 1440 rem enter player information
  141. 1450 ms$="how many players? (1 or 2)":gosub550:np=0:poke198,0:wait198,1
  142. 1460 geta$:ifa$<>"2"anda$<>"1"then1450
  143. 1470 ifa$="1"thensp=13:return
  144. 1480 sp=2:np=1:ms$="player 1, enter your name below":gosub550
  145. 1490 poke214,19:poke211,4:sys58732:li=7:gosub1550:pl$(0)=w$+" ":ifw$=""then1480
  146. 1500 ms$="player 2, enter your name below":gosub550
  147. 1510 poke214,19:poke211,23:sys58732:li=7:gosub1550:ifw$=""then1500
  148. 1520 pl$(1)=w$+" ":return
  149. 1530 rem enable/disable menu features
  150. 1540 fori=1to12:no(i)=val(mid$(no$,i,1)):next:return
  151. 1550 w$="":lw=0:print"[159]>[157]";:iflimit=0thenlimit=80
  152. 1560 geta$:ifa$="[145]"ora$=""ora$="[157]"ora$=""ora$=""ora$="[147]"ora$=""then1560
  153. 1570 lw=len(w$):as=asc(a$):ifas=13oras=141oras=20then1630
  154. 1580 ifa$>="[193]"anda$<="[218]"thenas=as-128:a$=chr$(as)
  155. 1590 ifpeek(653)=2orpeek(653)=4oras=148then1560
  156. 1600 iflw=limit and(as<>20andas<>13andas<>141)then1560
  157. 1610 ifas=34or(as>=133andas<=140)or(as>=1andas<=31)then1560
  158. 1620 w$=w$+a$:printa$">[157]";:lw=len(w$):goto1560
  159. 1630 ifas=20andw$=""then1560                                
  160. 1640 ifas=20andw$<>""thenw$=left$(w$,lw-1):print"[157]< [157]